package com.ocom.payconfig.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ocom.common.entity.card.EntityXfSubAccount;
import com.ocom.common.vo.payconfig.SubAccountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IDaoXfSubAccount extends BaseMapper<EntityXfSubAccount> {


    @Select("<script>" +
            "SELECT A.sub_account AS subAccount, A.sub_account_name AS subAccountName, A.merch_id AS merchId, " +
            "A.remark, M.merch_name AS merchName " +
            "FROM xf_sub_account AS A " +
            "LEFT JOIN xf_merchant_info AS M ON M.merch_id = A.merch_id " +
            "WHERE A.com_id = #{comId} " +
            "ORDER BY A.sub_account " +
            "</script>")
    List<SubAccountVo> getSubAccounts(@Param("comId") Long comId);

}
